//
//  GameViewController.swift
//  GomroClient
//
//  Created by xiaogxjkz on 2021/11/15.
//  Copyright © 2021 cn.gomro.app. All rights reserved.
//

import UIKit

class GameViewController: BaseViewController {
    
    
    //MARK: - override
    override func viewDidLoad() {
        super.viewDidLoad()
        
        // Do any additional setup after loading the view.
    }
    
    override func layoutNavigation() {
        //MARK:导航
        self.initNavgationBar()
        
        //MARK:标题
        self.initViewControllerTitle(strTitle: "K线游戏")
    }
    
    override func bindViewModel() {
        
    }
    
    override func addSubViews() {
        self.view.addSubview(self.btnStart)
        
        self.btnStart.snp.makeConstraints { make in
            make.width.equalTo(80)
            make.height.equalTo(35)
            make.center.equalToSuperview()
        }
    }
    
    override func updateViewConstraints() {
        
        super.updateViewConstraints()
    }
    
    
    //MARK: - lazy load
    private lazy var btnStart:UIButton = {
        let _btn = BaseView.createBtn(rect: .zero,
                                      strTitle: "进入游戏",
                                      titleColor: .purple,
                                      txtFont: UIFont.systemFont(ofSize: 16),
                                      image: nil,
                                      backgroundColor: .systemGray,
                                      borderColor: .purple,
                                      cornerRadius: 5,
                                      isRadius: true,
                                      backgroundImage: nil,
                                      borderWidth: 1)
        _btn.rac_signal(for: .touchUpInside).subscribeNext {[weak self] (_:Any?) in
            let vc = KLineViewController.init()
            self?.navigationController?.pushViewController(vc, animated: true)
        }
        return _btn
    }()
    
}

